package pattern.structural.facade;

/**
 * @author: chaoyang.ren  
 * @date:Jul 4, 2017  
 * @time:3:53:32 PM   
 * @email:chaoyang.ren@foxmail.com  
 * @version: 1.0
 */
public class Computer {  
    private Cpu cpu;  
    private Memory memory;  
    private Disk disk;  
      
    public Computer(){  
        cpu = new Cpu();  
        memory = new Memory();  
        disk = new Disk();  
    }  
      
    public void startup(){  
        System.out.println("start the computer!");  
        cpu.startup();  
        memory.startup();  
        disk.startup();  
        System.out.println("start computer finished!");  
    }  
      
    public void shutdown(){  
        System.out.println("begin to close the computer!");  
        cpu.shutdown();  
        memory.shutdown();  
        disk.shutdown();  
        System.out.println("computer closed!");  
    }  
} 

